package com.adnaan.backend.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
@TableName("goods_list")
@Schema(description = "商品信息")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Goods {

    @TableId(type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    @Schema(description = "商品名称")
    private String name;

    @Schema(description = "商品封面")
    private String cover;

    @Schema(description = "商品描述")
    private String description;

    @Schema(description = "价格")
    private BigDecimal price;

    @Schema(description = "库存")
    private Integer stock;

    @Schema(description = "类型：0-自营商品 1-供货商商品")
    private Integer type;

    @Schema(description = "供货商ID（type=1时必填）")
    private Long supplierId;

    @Schema(description = "状态：0-下架 1-上架")
    private Integer status;

    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

    //销量
    @Schema(description = "销量")
    @TableField(exist = false)
    private Long sales;

    //价格升序降序
    @Schema(description = "价格升序降序")
    @TableField(exist = false)
    private boolean priceOrder;

    //销量最高
    @Schema(description = "销量最高")
    @TableField(exist = false)
    private boolean salesOrder;
} 